package java_base;

public class Demo02_列表 {
    public static void main(String[] args) {
//         声明数组
        int [] li;
//        创建一个数组
        li = new int[10];
//给数据赋值
        li[0] = 1;
        li[1] = 2;
        li[2] = 3;
        li[3] = 4;
        li[4] = 5;
        li[5] = 6;
        li[6] = 7;
        li[7] = 8;
        li[8] = 9;
        li[9] = 10;
        int sum = 0;
        for(int i =0; i <li.length;i++){
            sum += li[i];
        }

        System.out.println(sum);
    }


}
